package com.groupalpha.helpers;

import com.groupalpha.studentport.R;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class AdapterPickerValTenta extends ArrayAdapter<String> {
	
	Context context;
    int layoutResourceId;   
    String[] val_list = null;
   
    public AdapterPickerValTenta(Context context, int layoutResourceId, String[] val_list) {
        super(context, layoutResourceId, val_list);
        this.layoutResourceId = layoutResourceId;
        this.context = context;
        this.val_list = val_list;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        View row = convertView;
        KursPickerHolder holder = null;
       
        if(row == null)
        {
            LayoutInflater inflater = ((Activity)context).getLayoutInflater();
            row = inflater.inflate(layoutResourceId, parent, false);
           
            holder = new KursPickerHolder();
            holder.txtTitle = (TextView)row.findViewById(R.id.txtTitle);
           
            row.setTag(holder);
        }
        else
        {
            holder = (KursPickerHolder)row.getTag();
        }
       
        
        holder.txtTitle.setText(val_list[position]);
        
       
        return row;
    }
   
    static class KursPickerHolder
    {
        
        TextView txtTitle;
    }
}


